package com.aaa.mrcai.service.impl;

import com.aaa.mrcai.mapper.CheckMapper;
import com.aaa.mrcai.pojo.entity.Check;
import com.aaa.mrcai.query.CheckQuery;
import com.aaa.mrcai.result.AjaxResult;
import com.aaa.mrcai.service.CheckService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.HashMap;
import java.util.List;

/**
 * @author meowyf
 * @version 1.0
 * @Name Z_MJ
 * @date 2021/12/19 20:31:09
 */
@Service
public class CheckServiceImpl implements CheckService {
    @Autowired
    private CheckMapper checkMapper;
    @Override
    public AjaxResult list(CheckQuery checkQuery) {
        List<Check> checks = checkMapper.list(checkQuery);
        System.out.println(checkQuery);
        Long totalCount = checkMapper.queryCheckTotalCount(checkQuery);
        System.out.println(checks+"'''''''''''''''''''''''''");
        HashMap<Object, Object> map = new HashMap<>();
        map.put("empListAll",checks);
        map.put("empNumber",totalCount);
        return AjaxResult.success(map);
    }

    @Override
    public AjaxResult listOther(int id) {
        Check check = checkMapper.listOther(id);
        return AjaxResult.success(check);
    }
}
